package cn.kgc.blogweb.service;

import cn.kgc.blogcommon.pojo.Category;
import cn.kgc.blogcommon.pojo.News;
import cn.kgc.blogcommon.pojo.Type;
import cn.kgc.blogcommon.pojo.User;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("blog-service")
public interface BlogService {

    @GetMapping("getAllTypes")
    public List<Type> getAllType();

    @GetMapping("getCategory")
    public List<Category> getCategory();

    @GetMapping("getAllNews")
    public List<News> getAllNews(@RequestParam("categoryId") Integer categoryId);

    @GetMapping("getUserById")
    public User getUserById(Integer userId);

    @GetMapping("getNewsById")
    public News getNewsById(@RequestParam("newsId") Integer newsId);

    @GetMapping("getPopularCategory")
    public List<Category> getPopularCategory();

    @GetMapping("getCategoryByTypeId")
    public List<Category> getCategoryByTypeId(@RequestParam("typeId") Integer typeId);

    @GetMapping("getMinId")
    public List<Integer> getMinId();

    @GetMapping("getHotNews")
    public List<News> getHotNews(@RequestParam("newsIdList") List<Integer> newsIdList);
}
